package com.nbicc.dp.wsgateway.service;

import com.nbicc.dp.wsgateway.common.WsPush;
import com.nbicc.dp.wsgateway.wsenum.PushEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;
import java.util.Date;

/**
 * @Author: lilingyan
 */
@Service
public class PublishWsPushSetServie {

    @Autowired
    private ApplicationEventPublisher publisher;

    public void widgetInstanceUpdate(Integer widgetInstanceId){
        WsPush wsPush = new WsPush();
        wsPush.setWidgetInstanceId(widgetInstanceId);
        wsPush.setPushEnum(PushEnum.UPDATE_NOTICE);
        wsPush.setDate(new Date());
        publisher.publishEvent(wsPush);
    }

}
